<div class="entry-edit bccolorswatch">
    <div class="entry-edit-head">
        <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Swatch icon config');?></h4>
    </div>
    <div class="fieldset fieldset-wide grid">
        <div class="hor-scroll">
            <table cellspacing="0" class="form-list">
                <thead>
                    <tr class="heading">
                        <th><span><?php echo $this->__('Option Name');?></span></th>
                        <th><span><?php echo $this->__('Icon For Option');?></span></th>
                        <th><span><?php echo $this->__('Color For Option');?></span></th>
                    </tr>
                </thead>
                <tbody>
                <?php $data = $this->bcGetAllOptionData($this->getRequest()->getParam('attribute_id'));?>
                <?php if(count($this->bcGetAllOption() > 0)) : ?>
                    <?php foreach($this->bcGetAllOption() as $key=>$value) : ?>
                        <tr>
                            <td class="even"><label><?php echo $value['label'];?></label></td>
                            <td class="even">
                                <?php if(isset($data['image'][$value['value']])) : ?>
                                    <img id="image-<?php echo $value['value'];?>" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)?>bc_colorswatch/<?php echo $data['image'][$value['value']];?>"/>
                                <?php endif;?>
                                <input class="input-file" type="file" value="" name="<?php echo $value['value'];?>image"/>
                            </td>
                            <td class="even"><input type="text"  value="" name="color[<?php echo $value['value'];?>]"/></td>
                        </tr>
                    <?php endforeach;?>
                <?php endif;?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    function addEnctype(){
        $('edit_form').writeAttribute('enctype', 'multipart/form-data');
    }
    Event.observe(window, 'load', addEnctype);
</script>
<style>
    .bccolorswatch input[type="file"], select{float:right}
</style>